import { createRouter, createWebHistory } from 'vue-router'
import MainView from '../views/MainView.vue'
import ScheduleView from '../views/ScheduleView.vue'
import LoginView from '../views/LoginView.vue'
import RepairView from '../views/RepairView.vue'
import MaterialPurchaseView from '../views/MaterialPurchaseView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: LoginView,
    },
    {
      path: '/main',
      name: 'main',
      component: MainView,
    },
    {
      // 产品管理
      path: '/product',
      name: 'about',
      component: () => import('../views/ProductView.vue'),
    },
    {
      // 人员管理
      path: '/person',
      name: 'about',
      component: () => import('../views/PersonView.vue'),
    },
    {
      // 物料管理
      path: '/material',
      name: 'about',
      component: () => import('../views/MaterialView.vue'),
    },
    {
      // 设备管理
      path: '/device',
      name: 'about',
      component: () => import('../views/DeviceView.vue'),
    },
    {
      // 部门管理
      path: '/dept',
      name: 'about',
      component: () => import('../views/DeptView.vue'),
    },
    {
      // 登录注册界面
      path: '/login',
      name: 'about',
      component: () => import('../views/LoginView.vue'),
    },
    {
      // 生产计划管理界面
      path: '/production-plan',
      name: 'production-plan',
      component: () => import('../views/ProductionPlanView.vue'),
    },
    {
      // 排程管理界面
      path: '/schedule',
      name: 'schedule',
      component: ScheduleView,
    },
    {
      // 数据看板界面
      path: '/dashboard',
      name: 'dashboard',
      component: () => import('../views/DashboardView.vue'),
    },

    {
      // 供应商管理界面
      path: '/provider',
      name: 'provider',
      component: () => import('../views/ProviderView.vue'),
    },
    {      // 设备报修管理界面
      path: '/repair',
      name: 'repair',
      component: RepairView,
    },
    {
      // 物料采购管理界面
      path: '/material-purchase',
      name: 'material-purchase',
      component: MaterialPurchaseView,
    },
    {
      // 供应商信息管理界面
      path: '/provider',
      name: 'about',
      component: () => import('../views/ProviderView.vue'),
    },
    {
      // 供应商审核信息管理界面
      path: '/provider_audit',
      name: 'about',
      component: () => import('../views/ProviderAuditView.vue'),
    },
  ],
})

export default router
